package com.rhb.erp.hr.department.web.struts.form;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

import com.rhb.erp.hr.department.bean.Department;
import com.rhb.erp.hr.department.bean.DepartmentQuery;
import com.rhb.web.struts.form.ListForm;

public class DepartmentForm extends ListForm {

	// Fields
	private Department department;
	private DepartmentQuery departmentQuery;
	private Document departmentXMLDoc;

	private String parentPk;
	private String parentName;
	
	public String getParentPk() {
		return parentPk;
	}

	public void setParentPk(String parentPk) {
		this.parentPk = parentPk;
	}

	public String getParentName() {
		return parentName;
	}

	public void setParentName(String parentName) {
		this.parentName = parentName;
	}

	public Document getDepartmentXMLDoc() {
		return departmentXMLDoc;
	}

	public void setDepartmentXMLDoc(Document departmentXMLDoc) {
		this.departmentXMLDoc = departmentXMLDoc;
	}

	// default construct
	public DepartmentForm() {
		department = new Department();
		departmentQuery = new DepartmentQuery();
	}
	
	// get, set
	public Department getDepartment() {
		return department;
	}

	public void setDepartment(Department department) {
		this.department = department;
	}

	public DepartmentQuery getDepartmentQuery() {
		return departmentQuery;
	}

	public void setDepartmentQuery(DepartmentQuery departmentQuery) {
		this.departmentQuery = departmentQuery;
	}

	// validate
	public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {

		ActionErrors errors = new ActionErrors();

		if ("add".equalsIgnoreCase(this.getBehavior()) || "edit".equalsIgnoreCase(this.getBehavior())) {
																										}

		return errors;
	}
}
